//
//  CarTableViewCell.m
//  明和智能
//
//  Created by 李李善 on 2018/8/27.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "CarTableViewCell.h"
@implementation CarTableViewCell

-(void)onAsInitAddView:(UIView *)view forViewController:(UIViewController *)ViewController forDataSource:(id)dataSource AtIndexPath:(NSIndexPath *)indexPath
{
    self.backgroundColor = [UIColor clearColor];
    UIView *v = ({
        UIView *l = [UIView new];
        l.backgroundColor = [UIColor whiteColor];
        [view addV:l];
        l;
    });
    
    UIView *bj = ({
        UIView *l = [UIView new];
        l.backgroundColor = [UIColor colorWithHexString:@"#dbdbdb"];
        [v addV:l];
        l;
    });
    
    UILabel *label = ({
        UILabel *l  = [UILabel new];
        l.text = @"大润发停车场 600km";
        l.font = kSysFont(kFitW(13));
        l.textColor = [UIColor blackColor];
        [v addV:l];
        l;
    });
    
    UILabel *label1 = ({
        UILabel *l  = [UILabel new];
        l.text = @"车位:57/200 白天:5¥ 晚上:4¥";
        l.font = kSysFont(kFitW(10));
        l.textColor = [UIColor blackColor];
        [v addV:l];
        l;
    });
    
    UIButton *button = ({
        UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"预约"];
        l.backgroundColor = hexCOLOR(@"FD8F25");
        l.cornerRadius = kFitH(35)/2;
        l.masksToBounds = YES;
        l.tag = 100;
        //[l AddTarget:ViewController Action:@selector(onClickButton:)];
        [v addV:l];
        l;
    });
    
    UILabel *label2 = ({
        UILabel *l  = [UILabel new];
        l.text = @"广州市白云区白云大道12号";
        l.font = kSysFont(kFitW(13));
        l.textColor = [UIColor blueColor];
        [v addV:l];
        l;
    });
    
    UIButton *button1 = ({
        UIButton *l = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"导航"];
        [l setNormalTitleColor:[UIColor blueColor]];
        [l setNormalImage:[UIImage imageNamed:@"lb_daohan_icon"]];
        l.titleLabel.font = kSysFont(kFitW(13));
        l.tag = 200;
        //[l AddTarget:ViewController Action:@selector(onClickButton:)];
        [v addV:l];
        l;
    });
    
    [self onMainSetSubViewFrame:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
        v.frame = CGRectMake(0, 0, size.width, size.height-kFitH(5));
        button.size = CGSizeMake(kFitW(80), kFitH(35));
        button.right = size.width-kFitW(15);
        button.top =kFitH(20);
        
        [label sizeToFit];
        label.left = kFitW(15);
        label.top = button.top;
        
        [label1 sizeToFit];
        label1.left = kFitW(15);
        label1.top = label.bottom+kFitH(5);
        
        bj.size = CGSizeMake(size.width, 0.5);
        bj.left = 0;
        bj.bottom =v.height-kFitH(35);
        
        [label2 sizeToFit];
        label2.left =kFitW(15);
        label2.top =bj.bottom+kFitH(10);
        
        [button1 sizeToFit];
        button1.right =size.width - kFitW(25);
        button1.top =bj.bottom+kFitH(10);
        [button1 layoutButtonWithEdgeInsetsStyle:(MKButtonEdgeInsetsStyleRight) imageTitleSpace:4];
        
    }];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end


@implementation CarTableHeaderFooterView

-(void)onAsInitAddView:(UIView *)view forViewController:(UIViewController *)ViewController forDataSource:(id)dataSource AtSection:(NSInteger)section
{

    
}

@end

